#include <all_wlib.h>
#pragma hdrstop
#pragma package(smart_init)
#pragma resource "*.dfm"

#include "osk_int.h"
#include "kf_Log.h"

TLogForm *LogForm;

void InitLog( void )
  {
     LogForm = new TLogForm( NULL );
     HLoadFormPos( MainFormOSK->cfg->SubKey("Log"), LogForm );
     LogForm->Show();
}
void LogText( CONSTSTR msg, ... )
  {  va_list a;
     AnsiString s;

     va_start( a,msg );
       s.vprintf( msg, a );
     va_end( a );

     LogForm->txtText->Lines->Insert( 0, s );
}

//---------------------------------------------------------------------------
__fastcall TLogForm::TLogForm(TComponent* Owner)
    : TForm(Owner)
  {
}
//---------------------------------------------------------------------------
void __fastcall TLogForm::FormClose(TObject *Sender, TCloseAction &Action)
{
     HSaveFormPos( MainFormOSK->cfg->SubKey("Log"), this );
}
//---------------------------------------------------------------------------
